package cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logistics.dal.mysql.logistics;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logistics.controller.admin.logistics.vo.LogisticsExportReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logistics.controller.admin.logistics.vo.LogisticsPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logistics.dal.dataobject.logistics.LogisticsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 小程序-物流公司 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LogisticsMapper extends BaseMapperX<LogisticsDO> {

    default PageResult<LogisticsDO> selectPage(LogisticsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LogisticsDO>()
                .betweenIfPresent(LogisticsDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(LogisticsDO::getName, reqVO.getName())
                .eqIfPresent(LogisticsDO::getCode, reqVO.getCode())
                .orderByDesc(LogisticsDO::getId));
    }

    default List<LogisticsDO> selectList(LogisticsExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<LogisticsDO>()
                .betweenIfPresent(LogisticsDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(LogisticsDO::getName, reqVO.getName())
                .eqIfPresent(LogisticsDO::getCode, reqVO.getCode())
                .orderByDesc(LogisticsDO::getId));
    }

}
